package com.struggle.rabbitmqconsumer.listener.direct;

import com.struggle.common.QueueConstants;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @className DirectReceiver2
 * @Description 消息接收监听类
 * @Author liuwj3
 * @Date 2019/10/12 0012 下午 2:13
 **/
@Component
// 监听队列的名称 test_direct_queue
@RabbitListener(queues = QueueConstants.DIRECT_QUEUE2)
public class DirectReceiver2 {
    @RabbitHandler
    public void process(String testMessage) {
        System.out.println(QueueConstants.DIRECT_QUEUE2 + "队列的消费者收到消息：" + testMessage);
    }
}
